package com.recsmile.sgs.entity;

import com.recsmile.sgs.core.Room;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;

/**
 * Created by Administrator on 2016/8/25.
 */
public class ClientRoom extends Room{
    private int capacity = 8;
    private boolean chatAllowed = true;
    private String name = "sanguosha";

    public int getCapacity() {
        return capacity;
    }

    public void setCapacity(int capacity) {
        this.capacity = capacity;
    }

    public boolean isChatAllowed() {
        return chatAllowed;
    }

    public void setChatAllowed(boolean chatAllowed) {
        this.chatAllowed = chatAllowed;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;

        if (!(o instanceof ClientRoom)) return false;

        ClientRoom that = (ClientRoom) o;

        return new EqualsBuilder()
                .append(roomId, that.roomId)
                .isEquals();
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder(17, 37)
                .append(roomId)
                .toHashCode();
    }
}
